package com.changou.system.filter;

import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.core.Ordered;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

public class UrlFilter implements Ordered, GlobalFilter {
    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
        System.out.println("这是第二个过滤器UrlFilter");
        String url = exchange.getRequest().getURI().getPath();
        System.out.println("url:"+url);
        return chain.filter(exchange);//放行
    }

    @Override
    public int getOrder() {

        return 2;
    }
}
